<!DOCTYPE html>

<html>



<head>

	<meta charset="utf-8">

	<title></title>
	<meta name="renderer" content="webkit">

	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<meta name="viewport"

		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">

	<link rel="stylesheet" href="/public/static/layuiadmin/layui/css/layui.css" media="all">

	<link rel="stylesheet" href="/public/static/layuiadmin/style/admin.css" media="all">

</head>



<body>

  <div class="layui-fluid">

    <div class="layui-card">

      <div class="layui-card-body" style="padding: 15px;">

        <form class="layui-form" action="{:url('save')}" method="post" lay-filter="component-form-group" id="moduleForm">

          <input type="hidden" name="id" value="{$id}">

          <div class="layui-form-item">

            <label class="layui-form-label">模块</label>

            <div class="layui-input-block">

              <select name="parent_id" lay-verify="required" lay-filter="parent_id">

                <option value="0" {if condition="$info.parent_id eq 0" }selected="selected" {/if}>顶级模块</option>

                {volist name="module" id="vo"}

                <option value="{$vo.id}" {if condition="$info.parent_id eq $vo.id" }selected="selected" {/if}>

                  {$vo.title}</option>

                {if condition="$vo['children']"}

                {volist name="vo['children']" id="vos"}

                <option value="{$vos.id}" {if condition="$info.parent_id eq $vos.id" }selected="selected" {/if}>

                  　┣{$vos.title}</option>

                {/volist}

                {/if}

                {/volist}

              </select>

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">模块名称</label>

            <div class="layui-input-block">

              <input type="text" name="title" value="{$info.title}" lay-verify="required" placeholder="请输入模块名称"

                autocomplete="off" class="layui-input">

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">英文名称</label>

            <div class="layui-input-block">

              <input type="text" name="en_name" value="{$info.en_name}" placeholder="请输入英文名称" autocomplete="off"

                class="layui-input">

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">模块路径</label>

            <div class="layui-input-block">

              <input type="text" name="path" value="{$info.path}" placeholder="请输入模块路径" autocomplete="off"

                class="layui-input">

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">前端路径</label>

            <div class="layui-input-block">

              <input type="text" name="web_path" value="{$info.web_path}" placeholder="请输入前端路径" autocomplete="off"
                class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">图标</label>

            <div class="layui-input-block">

              <input type="text" name="icon" value="{$info.icon}" placeholder="请输入图标" autocomplete="off"

                class="layui-input">

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">排序号</label>

            <div class="layui-input-block">

              <input type="text" name="orders" value="{$info.orders}" lay-verify="required" placeholder="请输入排序号"

                autocomplete="off" class="layui-input">

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">是否显示</label>

            <div class="layui-input-block">

              <input type="radio" name="show" value="1" title="显示" {if condition="$info.show eq 1" }checked="checked"

                {/if}>

              <input type="radio" name="show" value="2" title="不显示" {if condition="$info.show eq 2" }checked="checked"

                {/if}>

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">模块级别</label>

            <div class="layui-input-block">

              <select name="level" lay-filter="level">

                <option value="1" {if condition="$info.level eq 1" }selected="selected" {/if}>一级</option>

                <option value="2" {if condition="$info.level eq 2" }selected="selected" {/if}>二级</option>

                <option value="3" {if condition="$info.level eq 3" }selected="selected" {/if}>三级</option>

              </select>

            </div>

          </div>

          <div class="layui-form-item">

            <label class="layui-form-label">状态</label>

            <div class="layui-input-block">

              <input type="radio" name="status" value="1" title="正常" {if condition="$info.status eq 1"

                }checked="checked" {/if}>

              <input type="radio" name="status" value="2" title="停用" {if condition="$info.status eq 2"

                }checked="checked" {/if}>

            </div>

          </div>

          <div class="layui-form-item" style="display: none;">

            <label class="layui-form-label">描述</label>

            <div class="layui-input-block">

              <script id="container" name="content" type="text/plain">{$info.content}</script>

            </div>

          </div>

          <div class="layui-form-item layui-layout-admin">

            <div class="layui-input-block">

              <div class="layui-footer" style="left: 0;">

                <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">保存</button>

              </div>

            </div>

          </div>

        </form>

      </div>

    </div>

  </div>

  <script src="/public/static/layuiadmin/layui/layui.js"></script>

  <!-- 编辑器源码文件 -->

  <script type="text/javascript" src="/public/static/layuiadmin/ueditor/ueditor.config.js"></script>

  <!-- 配置文件 -->

  <script type="text/javascript" src="/public/static/layuiadmin/ueditor/ueditor.all.js"></script>

  <!-- 实例化编辑器 -->

  <script type="text/javascript">

    var ue = UE.getEditor('container');

  </script>

  <script>

    layui.config({

      base: '/public/static/layuiadmin/' // 静态资源所在路径

    }).extend({

      index: 'lib/index', // 主入口模块

      api: 'api'

    }).use(['index', 'form', 'laydate', 'api'], function () {

      var $ = layui.$,

        admin = layui.admin,

        element = layui.element,

        layer = layui.layer,

        laydate = layui.laydate,

        api = layui.api,

        form = layui.form;



      form.render(null, 'component-form-group');



      /* 监听提交 */

      form.on('submit(component-form-demo1)', function (data) {

        var dats = data.field;

        var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引

        dats.content = UE.getEditor('container').getContent();

        layer.msg('加载中', {

          icon: 16,

          shade: 0.01

        });

        api.ajax('{:url("save")}', 'post', 'json', dats, function (res) {

          layer.closeAll('loading');

          layer.msg(res.msg);

          parent.tables.reloads();

          setTimeout(function () {

            parent.layer.close(index);

          }, 500)

        });

        return false;

      });

    });

  </script>

</body>



</html>